<?php

namespace App\Listeners;

use App\Events\UpdateMenuSession;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Session;

class UpdateMenuSessionListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  UpdateMenuSession  $event
     * @return void
     */
    public function handle(UpdateMenuSession $event)
    {
        //清空文件缓存
        Cache::store('file')->forget('all_permission');

        //清除缓存
        Session::forget('admin_menus');

    }
}
